package top.lidee.module.clientApi.twice.applet.order;

import java.util.Arrays;
import java.util.Map;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import top.lidee.common.service.twice.applet.OmsWechatpayCiphertextService;
import top.lidee.framework.result.PageUtils;
import top.lidee.framework.result.ResponseResult;
import top.lidee.repository.model.twice.pojo.applet.OmsWechatpayCiphertextEntity;


/**
 * 微信支付订单支付结果通知参数表
 *
 * @author zhangzhan
 * @email 52194440@qq.com
 * @date 2024-10-17 18:12:08
 */
@Api("微信支付订单支付结果通知参数表")
@RestController
@RequestMapping("/clientApi/applet/omswechatpayciphertext")
public class OmsWechatpayCiphertextController {
    @Autowired
    private OmsWechatpayCiphertextService omsWechatpayCiphertextService;

    /**
     * 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "微信支付订单支付结果通知参数表列表")
    public ResponseResult list(@RequestBody Map<String, Object> params){
        PageUtils page = omsWechatpayCiphertextService.queryPage(params);

        return ResponseResult.okResultPage("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping(value = "/info/{wechatpayCiphertextId}",method = RequestMethod.GET)
    @ApiOperation(value = "微信支付订单支付结果通知参数表信息")
    public ResponseResult info(@PathVariable("wechatpayCiphertextId") Integer wechatpayCiphertextId){
		OmsWechatpayCiphertextEntity omsWechatpayCiphertext = omsWechatpayCiphertextService.getById(wechatpayCiphertextId);

        return ResponseResult.okResultPage("OmsWechatpayCiphertext", omsWechatpayCiphertext);
    }

    /**
     * 保存
     */
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    @ApiOperation(value = "微信支付订单支付结果通知参数表保存")
    public ResponseResult save(@RequestBody OmsWechatpayCiphertextEntity omsWechatpayCiphertext){
		omsWechatpayCiphertextService.save(omsWechatpayCiphertext);

        return ResponseResult.ok();
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update",method = RequestMethod.PUT)
    @ApiOperation(value = "微信支付订单支付结果通知参数表修改")
    public ResponseResult update(@RequestBody OmsWechatpayCiphertextEntity omsWechatpayCiphertext){
		omsWechatpayCiphertextService.updateById(omsWechatpayCiphertext);

        return ResponseResult.ok();
    }

    /**
     * 删除
     */
    @RequestMapping(value = "/delete",method = RequestMethod.DELETE)
    @ApiOperation(value = "微信支付订单支付结果通知参数表删除")
    public ResponseResult delete(@RequestBody Integer[] wechatpayCiphertextIds){
		omsWechatpayCiphertextService.removeByIds(Arrays.asList(wechatpayCiphertextIds));

        return ResponseResult.ok();
    }

}
